<template>
  <div class="dashboard-container">
    <div class="dashboard-editor-container">
      <el-row :gutter="40" class="panel-group">
        <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
          <div class="card-panel">
            <div class="card-panel-icon-wrapper icon-people">
              <i class="el-icon-user-solid"/>
            </div>
            <div class="card-panel-description">
              <div class="card-panel-text">
                {{ userInfo.user_name || userInfo.user_penname }}
              </div>
              <span class="card-panel-num"> {{ userInfo.user_verify }}</span>
            </div>
          </div>
        </el-col>
        <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
          <div class="card-panel">
            <div class="card-panel-icon-wrapper icon-message">
              <i class="el-icon-document"/>
            </div>
            <div class="card-panel-description">
              <div class="card-panel-text">
                回复总数
              </div>
              <span class="card-panel-num">{{ userInfo.reply_Count }}</span>
            </div>
          </div>
        </el-col>

      </el-row>
    </div>
  </div>
</template>

<script>

import {getInfo} from '@/api/user'

export default {
  name: 'Dashboard',

  data() {
    return {
      userInfo: []
    }
  },
  created() {
    this.getUserinfo()
  },
  methods: {
    getUserinfo() {
      getInfo({index:1}).then(r => {
            this.userInfo = r.data
      })
    }
  }

}
</script>

<style lang="scss" scoped>
.dashboard-editor-container {
  padding: 32px;
  background-color: rgb(240, 242, 245);
  position: relative;

  .github-corner {
    position: absolute;
    top: 0px;
    border: 0;
    right: 0;
  }

  .chart-wrapper {
    background: #fff;
    padding: 16px 16px 0;
    margin-bottom: 32px;
  }
}

.panel-group {
  margin-top: 18px;

  .card-panel-col {
    margin-bottom: 32px;
  }

  .card-panel {
    height: 108px;
    cursor: pointer;
    font-size: 12px;
    position: relative;
    overflow: hidden;
    color: #666;
    background: #fff;
    box-shadow: 4px 4px 40px rgba(0, 0, 0, .05);
    border-color: rgba(0, 0, 0, .05);


    .icon-people {
      font-size: 48px;
      color: #40c9c6;
    }

    .icon-message {
      font-size: 48px;
      color: #36a3f7;
    }

    .icon-money {
      font-size: 48px;
      color: #f4516c;
    }

    .icon-shopping {
      font-size: 48px;
      color: #34bfa3
    }

    .card-panel-icon-wrapper {
      float: left;
      margin: 14px 0 0 14px;
      padding: 16px;
      transition: all 0.38s ease-out;
      border-radius: 6px;
    }

    .card-panel-icon {
      float: left;
      font-size: 48px;
    }

    .card-panel-description {
      float: right;
      font-weight: bold;
      margin: 26px;
      text-align: right;
      margin-left: 0px;

      .card-panel-text {
        line-height: 18px;
        color: #20a0ff;
        font-size: 18px;
        margin-bottom: 12px;
      }

      .card-panel-num {
        font-size: 14px;
        color:#999;
      }
    }
  }
}

</style>
